package com.test.datasource.demo.com.user2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.HashMap;
import java.util.Map;

@Service
@SuppressWarnings("all")
public class UserService2 {

    @Autowired
    UserMapper2 userMapper2;

    @Transactional
    public int insertUser () {
        Map map = new HashMap<String, Object>();
        map.put("id", 123);
        map.put("userName", "廖开雷");
        map.put("email", "xdn541@163.com");
        int res =  userMapper2.insertUser(map);
        System.out.println("user插入成功");
        return res;
    }
}
